package ncme.auto.framework.test.permission.controller;

import ncme.auto.framework.core.annotation.aspect.AutoEntityProcess;
import ncme.auto.framework.core.annotation.aspect.AutoNoEntitySingleProcess;
import ncme.auto.framework.core.annotation.handler.AutoRequestBody;
import ncme.auto.framework.test.permission.entity.User;
import ncme.auto.framework.test.permission.service.impl.UserServiceImpl;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("permission")
@CrossOrigin
public class UserController {

    @RequestMapping("/user")
    @AutoEntityProcess(BUSINESS_ENTITY = User.class, LOG_MSG = "user", REQUEST_TYPE_CODE = "5234")
    public Object userAuto(@AutoRequestBody Map<String, Object> param) {
        return null;
    }

    @RequestMapping("/login")
    @AutoNoEntitySingleProcess(SERVICE_CLASS = UserServiceImpl.class, REQUIRED_PARAMS = "name,pwd", LOG_MSG = "登录", REQUEST_TYPE_CODE = "5")
    public Object login(@AutoRequestBody Map<String, Object> param) {
        return null;
    }

}
